package com.alibaba.system.service.impl;

import com.alibaba.basic.service.impl.BaseServiceImpl;
import com.alibaba.system.domain.SystemDictionaryType;
import com.alibaba.system.mapper.SystemDictionaryDetailMapper;
import com.alibaba.system.mapper.SystemDictionaryTypeMapper;
import com.alibaba.system.service.ISystemDictionaryTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SystemDictionaryTypeServiceImpl extends BaseServiceImpl<SystemDictionaryType> implements ISystemDictionaryTypeService {

    @Autowired
    private SystemDictionaryTypeMapper systemDictionaryTypeMapper;

    @Autowired
    private SystemDictionaryDetailMapper systemDictionaryDetailMapper;


    public void delete(Long id){
        try {
            systemDictionaryDetailMapper.del(id);
            systemDictionaryTypeMapper.delete(id);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void batchDelete(Long[] ids){
        try {
            systemDictionaryDetailMapper.delBatch(ids);
            systemDictionaryTypeMapper.batchDelete(ids);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
